package com.lex.newbasketball.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.TextView;

import com.lex.newbasketball.R;
import com.lex.newbasketball.base.BaseFragment;
import com.sam.ui.base.fragment.BaseParentFragment;
import com.sam.widget.headerBar.LeftImgSegmentedRightImgBar;
import com.sam.widget.segmented.OnSegmentCheckedChangeListener;


public class WonderFragment extends BaseParentFragment {
    private LeftImgSegmentedRightImgBar header;
    private static WonderFragment self;

    public synchronized static WonderFragment getInstance() {
        if (self == null) self = new WonderFragment();
        return self;
    }
    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.fragment_wonder);
        header = (LeftImgSegmentedRightImgBar) findViewById(R.id.header);
        String[] SegmentName = new String[]{"精彩瞬间","我的圈子"};
        header.setSegmentInfo(SegmentName, 0, new OnSegmentCheckedChangeListener() {
            @Override
            public void onSegmentCheckedChanged(ViewGroup viewGroup, int i, TextView textView) {
                switch (i){
                    case 0:
                        showFragment(R.id.content_wonder,ShowTimeFragment.getInstance());
                        break;
                    case 1:
                        showFragment(R.id.content_wonder,MyFriendsFragment.getInstance());
                        break;
                }
            }
        });
    }


    @Override
    protected void findView() {

    }

    @Override
    protected void initView() {

    }
}

